<include file="Public:_header" />
<div class="sty-detail">
   <header class="ui-header"> <a href="http://115.29.250.19/weixin/index.php?m=wxweb" class="ui-icon icon-btn btn-return">返回</a>
    <h1>注册账号</h1>
  </header>
  <article class="ui-detail">
    <section class="ui-blk">
      <header class="ui-blk-tit2">
        <h2>注册新用户 </h2>
        </header>
      <div class="ui-blk-cnt">
        <div class="detail-box">
        <div class="ui-editresume">
          <p>手机号：<input type="text" class="s-text phone" autocomplete="off" placeholder="只能填写手机号码" style="width:60%"/></p>
          <p class="codeinput" style="display:none">验证码：<input type="text" class="s-text yzcode" autocomplete="off" placeholder="填写验证码，半小时有效" style="width:60%" /></p>
		  <p class="getcodep" align="center" style="margin-top:20px; margin-bottom:20px;"><a href="javascript:;" class="ui-btn btn-orange getcode" style="width:50%">获取验证码</a></p>
          <p style="display:none">对不起，您的手机号码已经注册过，请直接登录，如遗忘密码，请点击“找回密码”</p>
          <p class="yzcode" style="display:none">验证码：<input type="text" class="s-text" autocomplete="off" placeholder="" style="width:60%" /></p>
          <p>昵&nbsp;&nbsp;&nbsp;&nbsp;称：<input type="text" class="s-text uname" autocomplete="off" placeholder="只允许英文、汉字或数字" style="width:60%" /></p>
         <p>密&nbsp;&nbsp;&nbsp;&nbsp;码：<input type="text" class="s-text pwd" autocomplete="off" placeholder="" style="width:60%" name="pwd"/></p>
        <p align="center" style="margin-top:20px;">
        <a href="javascript:;" class="ui-btn btn-blue reg" style="width:50%" onClick="">注册</a>
        </p>         
          </div>
        </div>
      </div>
    </section>
  </article> 
<script>
	$(document).ready(function(){
		$(".getcode").click(function(){
			phone = $(".phone").val();
			if(phone==''){
				alert('请填写手机号码');
				return false;
			}
			if(phone.match(/^1[3|4|5|8][0-9]\d{4,8}$/)){		
			}else{
				alert('请正确填写手机号码');
				return false;
			}
			
			$.post("__URL__/checkphone",{"phone":phone},function(res){

				if(res.status==0){
					alert(res.data);
				}else{
					$.post("__URL__/yzcode",{"phone":phone},function(res){
						if(res.status){
							alert(res.data);
							$(".getcodep").hide();
							$(".codeinput").show();
						}else{
							alert(res.data);
						}
					},'json');
				}
			},'json');
			//alert(phone);
		});
		$(".reg").click(function(){
			phone = $(".phone").val();
			uname = $(".uname").val();
			pwd = $(".pwd").val();
			yzcode = $(".yzcode").val();
			if(uname == ''){
				alert('请填写昵称');
				return false;
			}else if(pwd == ''){
				alert('请填写密码');
				return false;
			}else if(phone.match(/^1[3|4|5|8][0-9]\d{4,8}$/)){		
				$.post("__URL__/register",{"phone":phone,"uname":uname,"pwd":pwd,"yzcode":yzcode},function(res){
					admin.ajaxReload(res)	
				},'json');
			}else{
				alert('请正确填写手机号码');
			}
		});
	});

</script>
</div>
</body>
</html>
